package com.power.sifa.correction.dao;

import com.power.sifa.correction.model.Crw_rule_group;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.Repository;
import org.springframework.data.repository.query.Param;
import com.power.sifa.correction.model.Crw_rule_disabled;

import javax.transaction.Transactional;
import java.io.Serializable;
import java.util.List;

/**
 * 人员-屏蔽规则 持久层(hibernate)
 */

public interface Crw_rule_disabledDao extends JpaRepository<Crw_rule_disabled, Serializable>, JpaSpecificationExecutor<Crw_rule_disabled>, Repository<Crw_rule_disabled, Serializable>, Crw_rule_disabledDaoCustom<Crw_rule_disabled, Serializable> {

   @Modifying
   @Transactional
   @Query("delete  from Crw_rule_disabled s where  s.id in (:ids) ")
   void removeByIds(@Param("ids") List<String> ids);

   @Query(" from Crw_rule_disabled s where  s.id in (:ids) ")
   List<Crw_rule_disabled> findByIds(@Param("ids") List<String> ids);

   @Query(" from Crw_rule_disabled s where s.perid = :personId ")
   List<Crw_rule_disabled> findDisabledRuleByPersonId(@Param("personId") String personId);
}
